package com.ruoyi.merchant.service.impl;

import java.util.List;

import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.merchant.mapper.ReminderSettingsMapper;
import com.ruoyi.merchant.domain.ReminderSettings;
import com.ruoyi.merchant.service.IReminderSettingsService;
import com.ruoyi.common.core.text.Convert;

/**
 * 设备提醒设置Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-03
 */
@Service
public class ReminderSettingsServiceImpl implements IReminderSettingsService 
{
    @Autowired
    private ReminderSettingsMapper reminderSettingsMapper;

    /**
     * 查询设备提醒设置
     * 
     * @param id 设备提醒设置主键
     * @return 设备提醒设置
     */
    @Override
    public ReminderSettings selectReminderSettingsById(String id)
    {
        return reminderSettingsMapper.selectReminderSettingsById(id);
    }

    /**
     * 查询设备提醒设置列表
     * 
     * @param reminderSettings 设备提醒设置
     * @return 设备提醒设置
     */
    @Override
    public List<ReminderSettings> selectReminderSettingsList(ReminderSettings reminderSettings)
    {
        return reminderSettingsMapper.selectReminderSettingsList(reminderSettings);
    }

    /**
     * 新增设备提醒设置
     * 
     * @param reminderSettings 设备提醒设置
     * @return 结果
     */
    @Override
    public int insertReminderSettings(ReminderSettings reminderSettings)
    {
        reminderSettings.setCreateTime(DateUtils.getNowDate());
        return reminderSettingsMapper.insertReminderSettings(reminderSettings);
    }

    /**
     * 修改设备提醒设置
     * 
     * @param reminderSettings 设备提醒设置
     * @return 结果
     */
    @Override
    public int updateReminderSettings(ReminderSettings reminderSettings)
    {
        return reminderSettingsMapper.updateReminderSettings(reminderSettings);
    }

    /**
     * 批量删除设备提醒设置
     * 
     * @param ids 需要删除的设备提醒设置主键
     * @return 结果
     */
    @Override
    public int deleteReminderSettingsByIds(String ids)
    {
        return reminderSettingsMapper.deleteReminderSettingsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除设备提醒设置信息
     * 
     * @param id 设备提醒设置主键
     * @return 结果
     */
    @Override
    public int deleteReminderSettingsById(String id)
    {
        return reminderSettingsMapper.deleteReminderSettingsById(id);
    }
}
